<template>
	<view class="content1">
		<view class="cona box" style="display: flex;flex-direction: column;align-items: center;justify-content: center;">
		<text style="font-size:40rpx;">子组价A</text>
		</view>
		<view class="coma_box">
			<text>父组件传进来的值：</text>
			<text style="font-weight: bold;;color: red;">{{intent}}</text>
		</view>
		<button type="primary" @click="sendData()" style="width: 200px;">传值给compB组件</button>
	</view>
</template>

<script>
	export default {
		name:"compA",
		props:['intent'],
		data() {
			return {
				
			};
		},
		mounted(){
			console.log("ComA---mounted");
		},
		methods:{
			sendData(){
				console.log("ComA---sendData");
				uni.$emit('SendIntent',this.intent)
			}
		}
	}
</script>

<style>
.content1{
	background-color: bisque;
	height: 150px;
	padding-top: 20px;
	margin: 20px;
	
}
.coma_box{
	margin-top: 15px;
	margin-bottom: 15px;
	padding-left: 10px;
}
</style>